jQuery(document).ready(function(){
	jQuery(".divbox").corner("round 10px");
	jQuery(".titlebox").corner("round 10px");
	jQuery(".menubar").corner("round 10px");
	jQuery(".lancamentobar").corner("round 10px");
	jQuery(".destaquebar").corner("round 10px");
	jQuery(".menubar-contato").corner("round 10px");
	jQuery(".menu-body-search").corner("round 10px");
	jQuery("#form-anuncio\\:txt_preco").maskMoney({showSymbol:true,symbol:"R$", decimal:",", thousands:".", allowZero:true});
	
	jQuery("#form-anuncio\\:txt_area_util").keydown(function(event) {
		if ( event.keyCode == 46 || event.keyCode == 8 ) {
		
		} else {
		
			if (event.keyCode < 95) {
				if (event.keyCode < 48 || event.keyCode > 57 ) {
					event.preventDefault();
				}
			} else {
				if (event.keyCode < 96 || event.keyCode > 105 ) {
					event.preventDefault();
				}
			}
		}
	}); 
	
	jQuery('.limit-string').each(function(i, e){
	    var TextValue = jQuery(e).text();
	    var TextLimiter = 200;
	    var diminuido='';
	    if(TextValue.length > TextLimiter){
	      for(i=0;i<TextLimiter;i++) {  
	        diminuido+=TextValue.substr(i,1);  
	      }
	      jQuery(e).text(diminuido+'...');
	    }
	 });
	
});

function reloadMapa() {
	var saveCentre = zoomMap.getMap().getCenter();
	zoomMap.checkResize();
	zoomMap.getMap().setCenter(saveCentre);
}

function changingLoader(data) {
  var menuId = data.source.id;
  var progressbarId = "progressbar";
  if (data.status == "begin") {	
	document.getElementById(progressbarId).style.display='';  
  } else if (data.status == "success") {
	document.getElementById(progressbarId).style.display='none';
  }
}

function clearFieldsFormAtendimento() {
	document.getElementById("form-atendimento:nomeAtendimento").value = "";
	document.getElementById("form-atendimento:emailAtendimento").value = "";
	document.getElementById("form-atendimento:descricaoAtendimento").value = "";
}

function clearFieldsFormServico() {
	document.getElementById("form-servico:nomeServico").value = "";
	document.getElementById("form-servico:emailServico").value = "";
	document.getElementById("form-servico:descricaoServico").value = "";
}
function clearFieldsFormContato() {
	document.getElementById("form-contato:nomeMensagem").value = "";
	document.getElementById("form-contato:emailMensagem").value = "";
	document.getElementById("form-contato:descricaoMensagem").value = "";
}
